<div id="syncTabTree" class="demo-tree"></div>

<script type="text/javascript">

    $(function(){
        layui.use(['tree','layer'], function(){
            var tree = layui.tree
                ,layer = layui.layer

            var tabTree = $('#tempTabTreeData').data('tempTabTreeData');
            var layId = $('#tempSyncLayId').attr('layId');

            if (tabTree != null){
                tree.render({
                    elem: '#syncTabTree',
                    data: tabTree,
                    onlyIconControl: true,  //是否仅允许节点左侧图标控制展开收缩
                    click: function(obj){
                        document.getElementById("eTabName1").value= obj.data.title;

                        layer.close(layId);
                    }
                });
            }

        });
    })





</script>